﻿using System;

namespace CSharp_1209.Practice
{
    class Practice1
    {
        public static void Test()
        {
            Console.Write("Enter a number: ");
            int num = Convert.ToInt32(Console.ReadLine());

            int sum = 0, a = num, count = 0;
            bool isGreater = true;
            int right = 10, current = 0;

            while (a > 0)
            {
				// Đại
                //if ((a / 10) % 10 >= a % 10)
                //{
                //    isGreater = false;
                //}

                current = a % 10;
                sum = sum + current;
                a = a / 10;

                if (current >= right)
                    isGreater = false;

                right = current;
                count++;
            }

            Console.WriteLine("Sum = {0}", sum);
            Console.WriteLine(isGreater ? "true" : "false");
        }
    }
}
